<template>
  <div class="" style="width: 100%; height: 100%">
    <div style="height: 50%">
      <chartreyuan :pids.sync="pids1arr"/>
    </div>
    <div style="height: 50%">
      <chartreyuan :pids.sync="pids2arr"/>
    </div>
  </div>
</template>
<script>
export default {
  name: "commonreyuangongrelianglist",
  components: {},
  data() {
    return {
      pids1arr: [],
      pids2arr: [],
    };
  },
  computed: {},
  watch: {
    "$store.state.daping.bigScreen": {
      handler(n, o) {
        this.loadData(n)
      }
    },
  },
  mounted() {

  },
  methods: {
    loadData(n){
      if (this.pids1arr.length == 0) {
        let start_data = n.filter(v => v.attrName === 'heatplant_pids')
        let resarr = []
        start_data[0].attrValue.split(',').map(item => {
          resarr.push(item.split('@@')[1])
        })
        const half = Math.ceil(resarr.length / 2);    
 
        this.pids1arr = resarr.splice(0, half)
        this.pids2arr = resarr.splice(-half)
      }
    }
  },
};
</script>
<style lang='scss' scoped>
</style>